{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ArbitraryDiscretiser + MeanEncoder\n",
    "\n",
    "This is very useful for linear models, because by using discretisation + a monotonic encoding, we create monotonic variables with the target, from those that before were not originally. And this tends to help improve the performance of the linear model. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## ArbitraryDiscretiser\n",
    "\n",
    "The ArbitraryDiscretiser() divides continuous numerical variables into contiguous intervals arbitrarily defined by the user.\n",
    "\n",
    "The user needs to enter a dictionary with variable names as keys, and a list of the limits of the intervals as values. For example {'var1': [0, 10, 100, 1000],'var2': [5, 10, 15, 20]}.\n",
    "\n",
    "<b>Note:</b> Check out the ArbitraryDiscretiser notebook to learn more about this transformer."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MeanEncoder\n",
    "\n",
    "The MeanEncoder() replaces the labels of the variables by the mean value of the target for that label. <br>For example, in the variable colour, if the mean value of the binary target is 0.5 for the label blue, then blue is replaced by 0.5\n",
    "\n",
    "<b>Note:</b> Read MeanEncoder notebook to know more about this transformer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.pipeline import Pipeline\n",
    "\n",
    "from feature_engine.discretisation import ArbitraryDiscretiser\n",
    "from feature_engine.encoding import MeanEncoder\n",
    "\n",
    "plt.rcParams[\"figure.figsize\"] = [15,5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Load titanic dataset from OpenML\n",
    "\n",
    "def load_titanic():\n",
    "    data = pd.read_csv('https://www.openml.org/data/get_csv/16826755/phpMYEkMl')\n",
    "    data = data.replace('?', np.nan)\n",
    "    data['cabin'] = data['cabin'].astype(str).str[0]\n",
    "    data['pclass'] = data['pclass'].astype('O')\n",
    "    data['age'] = data['age'].astype('float').fillna(data.age.median())\n",
    "    data['fare'] = data['fare'].astype('float').fillna(data.fare.median())\n",
    "    data['embarked'].fillna('C', inplace=True)\n",
    "    data.drop(labels=['boat', 'body', 'home.dest', 'name', 'ticket'], axis=1, inplace=True)\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pclass</th>\n",
       "      <th>survived</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>cabin</th>\n",
       "      <th>embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>29.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>211.3375</td>\n",
       "      <td>B</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>0.9167</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>female</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>male</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>female</td>\n",
       "      <td>25.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  pclass  survived     sex      age  sibsp  parch      fare cabin embarked\n",
       "0      1         1  female  29.0000      0      0  211.3375     B        S\n",
       "1      1         1    male   0.9167      1      2  151.5500     C        S\n",
       "2      1         0  female   2.0000      1      2  151.5500     C        S\n",
       "3      1         0    male  30.0000      1      2  151.5500     C        S\n",
       "4      1         0  female  25.0000      1      2  151.5500     C        S"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = load_titanic()\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_train : (916, 8)\n",
      "X_test : (393, 8)\n"
     ]
    }
   ],
   "source": [
    "# let's separate into training and testing set\n",
    "X = data.drop(['survived'], axis=1)\n",
    "y = data.survived\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "    X, y, test_size=0.3, random_state=0)\n",
    "\n",
    "print(\"X_train :\", X_train.shape)\n",
    "print(\"X_test :\", X_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA20AAAE/CAYAAADVKysfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3df7Bc913e8fcTORjjBGLj+I4qaSKXakLsuLHpHZFOWriJ01iJGWQ6445SQ+Riqv5witPRDMgwQ6CtZtw/TGECBkSSRjMxMWrAtSZOIR4ltymdEMdOHGzZca3EwlakWpAfODelpjKf/nGPYFGurPtzz3d3368Zze5+7zm7z/n6Smcfn7NnU1VIkiRJktr0kr4DSJIkSZLOztImSZIkSQ2ztEmSJElSwyxtkiRJktQwS5skSZIkNczSJkmSJEkNs7RJkiSpCUleneRzSb6R5Cf7ziO14ry+A0iSJEmdnwJmq+rqvoNILfFImyRJklrxKuDwUldK4oEIjTVLm7QMSfYk+WJ3+sZjSX6kG1+X5I4kf5rkqSTvTFKndyZJvivJ+5KcSPLlJP8hybp+t0aSpP4l+TjwRuBXkswlubU7VfK5JM8k+fmBZTd3+9ebkzwNfLwb//Ekjyf5WpLfT/KqfrZGWl2WNml5vgj8Q+C7gF8APphkPfDPgbcCVwHfB1x/xnr7gVPA3wGuBt4C/MSQMkuS1KyqehPwP4B3VtXLgM8D7wBeAVwH/KskZ+5XfxB4DXBt97OfAf4x8MruuT40pPjSmkpV9Z1BGnlJHgbeDdwK/HZV/UY3/mbgfuClwHcDTwOvqKo/737+dmBXVb2xl+CSJDUkySzwwap67wI/+yWgqurfJtkMPAV8T1V9qfv5fwM+XFXv6x6/BJgDXlNVfzycLZDWhkfapGVI8o4kDyf5epKvA68FLgH+FvDMwKKD91/FfHk7MbDebwCXDiu3JEmjIsn3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tjOQenLfJ9xLjNwVLfl4zb9gNLfo8z1DkY9dL2GWBLksu6/yu9AzjYc6bFOgjs7O7vBO7tMcvfkCTMfwbo8ar6xYEftZz5lUle0d2/AHgz8AUazVxVt1XVxqrazPzv7cer6kdpNO9pSS5M8vLT94G3AI/SaO6q+t/AM0le3Q1dAzxGo3nP8Hb++tRIGI3MGi+jvI9dDWf7O3cQ2JHk/CSXAVuAB3rIt2qWsd8fxzlY6vuIsZqDZbwvGavth2W9xxnuHFTVSP8B3gb8L+CLwM/2necsGT8EnAD+H/Ot/Gbgu5m/As2T3e3FfeccyPsPmD+8+0fAw92ftzWe+e8Cn+syPwr8XDfebOaB7DPAR0YhL/OfEft89+fw6b9zLedm/ipgD3a/G/8VuKjlvF3m7wC+AnzXwFjTmf0znn9GYR+7Stu5pP008LPdnDwBvLXv/Kuw/Uve7/y3fO4AAABoSURBVI/hHCz5fcS4zcHAdi3qfcm4bf9y3uMMcw7SvaAkSZIkqUGjfnqkJEmSJI01S5skSZIkNczSJkmSJEkNs7RJkiRJUsMsbZIkSZLUMEubJEmSJDXM0iZJkiRJDbO0SZIkSVLD/j+UgSC64ypSUwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# we will transform two continuous variables\n",
    "X_train[[\"age\", 'fare']].hist(bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('ArbitraryDiscretiser',\n",
       "                 ArbitraryDiscretiser(binning_dict={'age': [0, 18, 30, 50, 100],\n",
       "                                                    'fare': [-1, 20, 40, 60, 80,\n",
       "                                                             600]},\n",
       "                                      return_boundaries=False,\n",
       "                                      return_object=True)),\n",
       "                ('MeanEncoder', MeanEncoder(variables=['age', 'fare']))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# set up the discretiser\n",
    "arb_disc = ArbitraryDiscretiser(\n",
    "    binning_dict={'age': [0, 18, 30, 50, 100],\n",
    "                  'fare': [-1, 20, 40, 60, 80, 600]},\n",
    "    # returns values as categorical\n",
    "    return_object=True)\n",
    "\n",
    "# set up the mean encoder\n",
    "mean_enc = MeanEncoder(variables=['age', 'fare'])\n",
    "\n",
    "# set up the pipeline\n",
    "transformer = Pipeline(steps=[('ArbitraryDiscretiser', arb_disc),\n",
    "                              ('MeanEncoder', mean_enc),\n",
    "                              ])\n",
    "# train the pipeline\n",
    "transformer.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'age': [0, 18, 30, 50, 100], 'fare': [-1, 20, 40, 60, 80, 600]}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "transformer.named_steps['ArbitraryDiscretiser'].binner_dict_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'age': {0: 0.45081967213114754,\n",
       "  1: 0.34309623430962344,\n",
       "  2: 0.4262948207171315,\n",
       "  3: 0.4153846153846154},\n",
       " 'fare': {0: 0.288135593220339,\n",
       "  1: 0.43283582089552236,\n",
       "  2: 0.5636363636363636,\n",
       "  3: 0.45652173913043476,\n",
       "  4: 0.7349397590361446}}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "transformer.named_steps['MeanEncoder'].encoder_dict_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>cabin</th>\n",
       "      <th>embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1139</th>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>0.426295</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.288136</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>533</th>\n",
       "      <td>2</td>\n",
       "      <td>female</td>\n",
       "      <td>0.343096</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.432836</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>459</th>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>0.426295</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.432836</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1150</th>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>0.343096</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.288136</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>393</th>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>0.343096</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.432836</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     pclass     sex       age  sibsp  parch      fare cabin embarked\n",
       "1139      3    male  0.426295      0      0  0.288136     n        S\n",
       "533       2  female  0.343096      0      1  0.432836     n        S\n",
       "459       2    male  0.426295      1      0  0.432836     n        S\n",
       "1150      3    male  0.343096      0      0  0.288136     n        S\n",
       "393       2    male  0.343096      0      0  0.432836     n        S"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_t = transformer.transform(X_train)\n",
    "test_t = transformer.transform(X_test)\n",
    "\n",
    "test_t.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAboAAAFNCAYAAAB2YKokAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3dd5hU5fnG8e/D0tvSO0uTJtIXFFusETUGFcUesUTRqLFGTVNjfrHGFk0IJoiKEVFRiQ0rYCyRtvQiILBLLwtLW9jy/P6YgxnXLcOyszM7c3+ua65rzpwzM8+eOTP3vue87znm7oiIiCSqarEuQEREJJoUdCIiktAUdCIiktAUdCIiktAUdCIiktAUdCIiktAUdFJuZjbVzK4u53PTzGyXmaVUdF1h73GvmY0vZf5CMzuhnK/tZnZYuYuLc2Z2jpllBp9R/1jXczAS/bORg6egS3JmtsrM9gY/aBvMbJyZ1Y/S+5xyYNrd17h7fXcvqOj3ipS793L3qZX9vlXkh/hR4IbgM5oT62IqyqH8c5YI75+sFHQCcJa71wf6Af2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EeE1mWVlfQtOnfPN7MbgCmEeiKNdfeFZjYqmD8aGA78zMzygL3ABWGdU5JWhOtOShDh+jsPuM7M8gltexdq24ts3bn7YjN7H5gHFAL/cPcFsas6fhzEd/cc4IOgVVxl6cwoIiKS0LTrUkREEpqCTkREEpqCTkREEpqCTkREEpqCTkREEpqCTiROmdlNZrbYzF6KdS0iVZmGF4jEqeDcqqe7+7cRLFvd3fMroSyRKifpB4yLxCMzG03oEiqTzWw8oTPL1yE0aPwKd19qZiOBM4HaQD0zOwv4C9Cb0Hf7Xnev0me0EKkIatGJxCkzW0XoXKH7gT3B2SxOAa5z9+FB0P0R6OPu28zsT8Aidx9vZo2Ar4H+Vf2sFiKHSi06kfiXCjxvZl0JnWG+Rti8D8POKv9j4KdmdnswXRtIQ+d3lCSnoBOJf/cDn7r7OWbWEZgaNi+8tWbAcHdfWnmlicQ/9boUiX+pwNrg/shSlpsC3Bh2tYP+Ua5LpEpQ0InEv4eBB8zsc0Jnmi/J/YR2a84zswXBtEjSU2cUERFJaGrRiYhIQlPQiYhIQlPQiYhIQlPQiYhIQlPQiYhIQlPQiYhIQlPQiYhIQlPQiYhIQvt/bXNc1jJy0X0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# let's explore the monotonic relationship\n",
    "plt.figure(figsize=(7, 5))\n",
    "pd.concat([test_t, y_test], axis=1).groupby(\"fare\")[\"survived\"].mean().plot()\n",
    "plt.title(\"Relationship between fare and target\")\n",
    "plt.xlabel(\"fare\")\n",
    "plt.ylabel(\"Mean of target\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can observe an almost linear relationship between the variable \"fare\" after the transformation and the target."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "fengine",
   "language": "python",
   "name": "fengine"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
